[#include "/app/common/layout/__backstagemainlayout.html"/]
[@mainlayout pageJavascript=pageJavascript pageCss=pageCss currentMenu="organizationFlag-positionFlag-positionsListFlag"]

<div class="page-header">
	<h1>
		职位管理 
		<small> <i class="ace-icon fa fa-angle-double-right"></i> 职位列表</small>
	</h1>
</div>
<form class="bs-example bs-example-form" role="form" action="${ContextPath}/admin/position" method="post">
	<div class="row">
		<div class="col-xs-4" >
			<div class="input-group">
				<span class="input-group-addon">关键字</span> 
				<input class="form-control" id="position" name="position" value="${(position)!}" placeholder="职位名称" type="text" autocomplete="off">
				<span class="input-group-btn">
					<button class="btn btn-sm btn-default">
						<span class="glyphicon glyphicon-search"></span>查找
					</button>
				</span>
			</div>
		</div>
	</div>
</form>
<div class="hr hr-dotted"></div>
<table class="table table-bordered table-hover">
		<thead>
			<tr>
				<th>序号</th>
				<th>所属部门</th>
				<th >职位名称</th>
				<th>创建时间</th>
				<th>状态</th>
				<th>操作</th>
			</tr>
		</thead>
		<tbody>
			[#list positionPage.getList() as position]
			<tr>
				<td>${(position_index+1)!}</td>
				<td>${(position.apartment_name)!}</td>
				<td> ${(position.name)!}</td>
				<td> ${(position.created_at)!}</td>
				<td>
					<b>
					[#if position.deleted_at??]
					<span class="red">禁用</span>
					[#else]
					<span class="gray">正常</span>
					[/#if]
					</b>
				</td>
				<td>
				<div class="action-buttons">
				<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/position/edit?id=${(position.id)!}" >编辑</a>
				[#if position.deleted_at??]
				<a class="btn btn-minier btn-danger btn-xs"  href="${ContextPath}/admin/position/on?id=${(position.id)!}" >启用</a>
				[#else]
				<a class="btn btn-minier btn-primary btn-xs"  href="${ContextPath}/admin/position/off?id=${(position.id)!}" >禁用</a>
				[/#if]
				</div>
				</td>
			</tr>
			[/#list]
			[#if positionPage.getList().size()!=10]
			[#assign size=(10-positionPage.getList().size())]
				[#list 1..size as t]
					<tr>
						<td>${(positionPage.getList().size()+t)!}</td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
						<td></td>
					</tr>
				[/#list]
			[/#if]
		</tbody>
	</table>
	[#include "/app/common/inc/_paginate.html" /]
	[@paginate currentPage=positionPage.pageNumber totalPage=positionPage.totalPage actionUrl="/admin/position/" /]
[/@mainlayout]